﻿using System;
using System.IO;
using System.Windows.Data;

namespace HobSoft.SoccerBet2014.Client.Common
{
    public class FileViewConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            if (value == null) return string.Empty;
            var fullFile = value.ToString();
            if (fullFile.Trim() == string.Empty) return string.Empty;
            return Path.GetFileName(fullFile);
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
